<html>
<head><meta charset="utf-8"><title>Constrained Naked Functions · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Constrained.20Naked.20Functions.html">Constrained Naked Functions</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="248397933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Constrained%20Naked%20Functions/near/248397933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathaniel McCallum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Constrained.20Naked.20Functions.html#248397933">(Aug 04 2021 at 19:37)</a>:</h4>
<p><span class="user-mention" data-user-id="143274">@Amanieu</span> <span class="user-mention" data-user-id="239881">@Josh Triplett</span> I have updated the wording of <a href="https://github.com/rust-lang/rfcs/pull/2972">the RFC</a> to be, I think, final. We also have only two small PRs left open to implement the whole thing. How do we move the RFC towards acceptance? I'd really like for <code>#[naked]</code> to be on the stabilization track along with <code>asm!</code>. What do I need to do at this point?</p>



<a name="248409456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Constrained%20Naked%20Functions/near/248409456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Constrained.20Naked.20Functions.html#248409456">(Aug 04 2021 at 21:09)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="239881">@Josh Triplett</span> since this is a lang RFC.</p>



<a name="248409567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Constrained%20Naked%20Functions/near/248409567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Constrained.20Naked.20Functions.html#248409567">(Aug 04 2021 at 21:10)</a>:</h4>
<p>My understanding is that we can't actually stabilize naked function before stabilizing <code>asm!</code>, so stabilization of <code>#[naked]</code> is blocked for now. I'm not sure if this blocks the RFC as well.</p>



<a name="248410583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Constrained%20Naked%20Functions/near/248410583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Constrained.20Naked.20Functions.html#248410583">(Aug 04 2021 at 21:19)</a>:</h4>
<p>Technically there's no <em>blocker</em> there, naked functions just aren't <em>useful</em> without asm.</p>



<a name="248410620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Constrained%20Naked%20Functions/near/248410620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Constrained.20Naked.20Functions.html#248410620">(Aug 04 2021 at 21:19)</a>:</h4>
<p>(Well, I suppose they can't usefully return without asm, either, so fair enough.)</p>



<a name="248410667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Constrained%20Naked%20Functions/near/248410667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Constrained.20Naked.20Functions.html#248410667">(Aug 04 2021 at 21:20)</a>:</h4>
<p>But nonetheless we can get them on the stabilization track <em>with</em> asm.</p>



<a name="248410954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Constrained%20Naked%20Functions/near/248410954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Constrained.20Naked.20Functions.html#248410954">(Aug 04 2021 at 21:23)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/131828-t-compiler/topic/Constrained.20Naked.20Functions/near/248410620">said</a>:</p>
<blockquote>
<p>(Well, I suppose they can't usefully return without asm, either, so fair enough.)</p>
</blockquote>
<p>Incidentally, do we lint against empty naked functions (without an <code>asm!</code>)?</p>



<a name="248413705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Constrained%20Naked%20Functions/near/248413705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathaniel McCallum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Constrained.20Naked.20Functions.html#248413705">(Aug 04 2021 at 21:52)</a>:</h4>
<p><span class="user-mention silent" data-user-id="143274">Amanieu</span> <a href="#narrow/stream/131828-t-compiler/topic/Constrained.20Naked.20Functions/near/248410954">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/131828-t-compiler/topic/Constrained.20Naked.20Functions/near/248410620">said</a>:</p>
<blockquote>
<p>(Well, I suppose they can't usefully return without asm, either, so fair enough.)</p>
</blockquote>
<p>Incidentally, do we lint against empty naked functions (without an <code>asm!</code>)?</p>
</blockquote>
<p><a href="https://github.com/rust-lang/rust/blob/master/src/test/ui/asm/naked-functions.rs#L74-L78">Yes.</a></p>



<a name="248413743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Constrained%20Naked%20Functions/near/248413743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathaniel McCallum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Constrained.20Naked.20Functions.html#248413743">(Aug 04 2021 at 21:52)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/131828-t-compiler/topic/Constrained.20Naked.20Functions/near/248410667">said</a>:</p>
<blockquote>
<p>But nonetheless we can get them on the stabilization track <em>with</em> asm.</p>
</blockquote>
<p>This is precisely what I'm hoping for.</p>



<a name="248414876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Constrained%20Naked%20Functions/near/248414876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathaniel McCallum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Constrained.20Naked.20Functions.html#248414876">(Aug 04 2021 at 22:04)</a>:</h4>
<p><span class="user-mention silent" data-user-id="143274">Amanieu</span> <a href="#narrow/stream/131828-t-compiler/topic/Constrained.20Naked.20Functions/near/248409567">said</a>:</p>
<blockquote>
<p>My understanding is that we can't actually stabilize naked function before stabilizing <code>asm!</code>, so stabilization of <code>#[naked]</code> is blocked for now. I'm not sure if this blocks the RFC as well.</p>
</blockquote>
<p>If I understand the process correctly, the RFC can be accepted and merged before implementation. We <em>also</em> already have the implementation. So we did things in parallel.</p>



<a name="248430957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Constrained%20Naked%20Functions/near/248430957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Constrained.20Naked.20Functions.html#248430957">(Aug 05 2021 at 02:13)</a>:</h4>
<p>Oh, yeah, this would be pretty great to have on the stabilization track with <code>asm!</code>.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>